package com.gitee.netty;

import io.netty.channel.group.ChannelGroup;
import io.netty.channel.group.DefaultChannelGroup;
import io.netty.util.concurrent.GlobalEventExecutor;

/**
 * 定义一个channel组，管理所有channel
 * 使用单例模式
 */
public class NettyConfig {

    //定义一个channel组，管理所有channel
    private static ChannelGroup channelGroup = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE);

    private NettyConfig() {
    }

    /**
     * 获取channel组
     */
    public static ChannelGroup getChannelGroup() {
        return  channelGroup;
    }
}
